<template>
  <div>
    <div v-if="msg == 0">
      <GoodsList :goods-id="0"></GoodsList>
    </div>
    <div v-else-if="msg == 1">
      <GoodsList :goods-id="1"></GoodsList>
    </div>
    <div v-else-if="msg == 2">
      <GoodsList :goods-id="2"></GoodsList>
    </div>
    <div v-else>
      <GoodsList :goods-id="0"></GoodsList>
    </div>
  </div>
</template>
<script>

  import Msg from './Msg.js'
  import GoodsList from './GoodsList.vue'

  export default({
    data: function(){
      return {
        msg: 0
      }
    },
    mounted: function(){
      let _this = this
      Msg.$on('key', function(val){
        _this.msg = val
      })
    },
    components: {
      GoodsList
    }
  })
</script>